package com.ycsj.goldmedalnewconcept.teacher.adapter;


import android.content.Context;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ycsj.common.base.CommonAdapter;
import com.ycsj.common.base.ViewHolder;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.teacher.bean.ContentInfo;

import java.util.List;


/**
 * 试卷整体情况的表格适配器
 * Created by Administrator on 2018/10/23 0023.
 */

public class ContentLvAdapter extends CommonAdapter<ContentInfo> {
    public ContentLvAdapter(Context context, List<ContentInfo> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, ContentInfo info) {
        LinearLayout llOut = holder.getView(R.id.ll_out);
        if (holder.getPosition() % 2 != 0) {
            //偶数行
            llOut.setBackgroundResource(R.color.tv_app_double);
        } else {
            //奇数行
            llOut.setBackgroundResource(R.color.tv_app_siglon);
        }

        //知识点
        TextView tvZsd = holder.getView(R.id.tv_name);
        tvZsd.setText(info.zsd);

        //题数
        TextView tvTs = holder.getView(R.id.tv_num);
        tvTs.setText(info.ts);

        //全班正确率
        TextView tvQbzql = holder.getView(R.id.tv_qbzql);
        tvQbzql.setText(info.qbzql);

    }
}
